<template>
	<view class="container">
		<!-- 企业信息选项卡部分 -->
		<view class="mybox">
			<view class="mybox-list" v-for="(item, index) in mySelfList" :key="index" @click="urlClick(item)"
				:class="item.background">
				<text>{{ item.name }}</text>
			</view>
		</view>
		<view class="" style="text-align: center;margin-top: 50rpx;">
			版本号： v{{nowVersion}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 当前版本号
				nowVersion: "v1.0.0",
				// 企业信息选项卡
				mySelfList: [{
						key: 1,
						img: "/static/weixin.png",
						name: "修改密码",
						path: "/pages/Login/UpdatePassword",
						background: "background1"
					},
					{
						key: 2,
						img: "/static/weixin.png",
						name: "权限列表",
						path: "/pages/Authority/Authority",
						background: "background2"
					}
				],
			}
		},
		onShow() {
			// 动态获取版本号
			uni.getSystemInfo({
				success: (res) => {
					this.nowVersion = res.appVersion;
					console.log(res)
				}
			});
			// // #ifdef APP-PLUS
			// // APP 获取本地应用资源版本号
			// plus.runtime.getProperty(plus.runtime.appid, (info) => {
			// 	console.log(info)
			// 	this.nowVersion = 'v' + info.version;
			// })
			// // #endif
		},
		methods: {
			// 点击跳转
			urlClick(item) {
				console.log('点击跳转了', item)
				uni.navigateTo({
					url: item.path
				})
			},
		}
	}
</script>

<style lang="less" scoped>
	.container {
		.mybox {
			.mybox-list {
				height: 180rpx;
				border-radius: 20rpx;
				margin: 20rpx;
				line-height: 180rpx;
				text-align: center;
				font-size: 30rpx;
				color: #fff;
				letter-spacing: 5rpx;
				font-weight: bold;
			}

			.background1 {
				background-image: url(../../static/back1.png);
				background-size: cover;
			}

			.background2 {
				background-image: url(../../static/back2.png);
				background-size: cover;
			}
		}

	}
</style>